/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model.dao;

import lib.*;
import model.dao.vo.*;

import java.sql.*;
import java.util.*;

/**
 *
 * @author felipe
 */
public class ExibicaoDAO extends DAO {

    public ExibicaoDAO()
    {
        super();
    }

    public ExibicaoVO buscaExibicao(ExibicaoVO exibicao)
    {
        SQL sql = Factory.createSQL();
        sql = sql.select("categoria_nome")
                .from("exibicao")
                .where("exibicao_id = " + exibicao.getId());
        ResultSet rs = this.db.Execute(sql.toString());
        try
        {
            if ( ! rs.wasNull() )
            {
                exibicao.setId(rs.getInt("exibicao_id"));
                
                exibicao.setQtdeIngresso(rs.getInt("exibicao_ingressos_qtde"));
                return exibicao;
            }
        }
        catch( SQLException e )
        {
            ErrorLog.SQLLog("Error Main method " , e);
        }
        return null;
    }

    public Iterator<ExibicaoVO> listaExibicao(ExibicaoVO exibicao)
    {
        List<ExibicaoVO> exibicoes = new ArrayList<ExibicaoVO>();
        return exibicoes.iterator();
    }

    public boolean insereExibicao(ExibicaoVO exibicao)
    {
        return false;
    }

}
